<template>
  <div class="home-page">
    <!-- 英雄区域 -->
    <section class="hero-section" :style="{minHeight:heroSectionHeight}" @mouseenter="mouseEleMent">
      <div class="hero-bg-mask"></div>
      <div class="hero-container">
        <div class="hero-content">
          <h1 class="hero-title">智盾清源</h1>
          <p class="hero-subtitle">多模态AI技术滥用治理和网络谣言净化卫士</p>
          <p class="hero-description">
            集成先进的深度学习模型，为您提供全方位的信息真实性验证与反诈骗保护服务
          </p>
          <div class="hero-actions">
            <router-link to="/rumor-query" class="btn btn-primary">立即检测</router-link>
            <router-link to="/about" class="btn btn-secondary">了解更多</router-link>
          </div>
        </div>
        <!-- <div class="hero-image">
          <div class="shield-icon">🛡️</div>
          <div class="search-icon">🔍</div>
        </div> -->

      </div>
    </section>

    <!-- 核心功能区域 -->
    <section class="features-section">
      <div class="section-container">
        <h2 class="section-title">核心功能</h2>
        <div class="features-grid">
          <div class="feature-card" v-for="feature in features" :key="feature.id">
            <div class="feature-icon">{{ feature.icon }}</div>
            <h3 class="feature-title">{{ feature.title }}</h3>
            <p class="feature-description">{{ feature.description }}</p>
            <div class="feature-stats">
              <span class="stat-item">准确率: {{ feature.accuracy }}</span>
              <span class="stat-item">响应时间: {{ feature.responseTime }}</span>
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- 快速检测区域 -->
    <section class="quick-detection-section">
      <div class="section-container">
        <h2 class="section-title">快速检测</h2>
        <div class="detection-tabs">
          <button 
            v-for="tab in detectionTabs" 
            :key="tab.id"
            @click="activeTab = tab.id"
            :class="['tab-button', { active: activeTab === tab.id }]"
          >
            {{ tab.name }}
          </button>
        </div>
        <div class="detection-content">
          <!-- 文本检测 -->
          <div v-if="activeTab === 'text'" class="detection-panel">
            <textarea 
              v-model="textInput"
              placeholder="请输入需要检测的文本内容..."
              class="text-input"
            ></textarea>
            <div class="detection-actions">
              <button @click="detectText" class="btn btn-primary" :disabled="isDetecting">
                {{ isDetecting ? '检测中...' : '检测文本' }}
              </button>
              <button @click="clearText" class="btn btn-secondary">清空</button>
            </div>
          </div>
          
          <!-- 图片检测 -->
          <div v-else-if="activeTab === 'image'" class="detection-panel">
            <div class="upload-area" @click="uploadImage" v-if="!selectedImage">
              <div class="upload-icon">📷</div>
              <p>点击上传图片</p>
              <p class="upload-hint">支持 JPG、PNG、GIF 格式，最大 10MB</p>
              <input type="file" ref="imageInput" accept="image/*" style="display: none" @change="handleImageUpload">
            </div>
            
            <!-- 图片预览 -->
            <div class="image-preview" v-if="selectedImage && !isDetecting">
              <img :src="imagePreview" alt="预览图片" class="preview-image">
              <div class="image-info">
                <p class="image-name">{{ selectedImage.name }}</p>
                <p class="image-size">{{ formatFileSize(selectedImage.size) }}</p>
              </div>
              <button @click="clearImage" class="btn btn-secondary btn-sm">重新选择</button>
            </div>
            
            <div class="detection-actions">
              <button @click="detectImage" class="btn btn-primary" :disabled="!selectedImage || isDetecting">
                {{ isDetecting ? '检测中...' : '检测图片' }}
              </button>
            </div>
          </div>
          
          <!-- 检测进度 -->
          <div class="detection-progress" v-if="isDetecting">
            <div class="progress-bar">
              <div class="progress-fill" :style="{width: detectionProgress + '%'}"></div>
            </div>
            <div class="progress-text">
              <span>{{ detectionStage }}</span>
              <span>{{ detectionProgress }}%</span>
            </div>
            <div class="detection-animation">
              <div class="scanner"></div>
            </div>
          </div>
          
          <!-- 检测结果 -->
          <div class="detection-result" v-if="detectionResult">
            <div class="result-header">
              <h3>检测结果</h3>
              <button @click="clearResult" class="btn btn-secondary btn-sm">清除结果</button>
            </div>
            
            <div class="result-card" :class="detectionResult.status">
              <div class="result-icon">
                <i :class="detectionResult.icon"></i>
              </div>
              <div class="result-content">
                <h4>{{ detectionResult.title }}</h4>
                <p>{{ detectionResult.description }}</p>
                <div class="result-metrics">
                  <div class="metric">
                    <span class="metric-label">可信度</span>
                    <div class="metric-bar">
                      <div class="metric-fill" :style="{width: detectionResult.confidence + '%'}"></div>
                    </div>
                    <span class="metric-value">{{ detectionResult.confidence }}%</span>
                  </div>
                  <div class="metric">
                    <span class="metric-label">风险等级</span>
                    <span class="risk-level" :class="detectionResult.riskLevel">
                      {{ getRiskLevelText(detectionResult.riskLevel) }}
                    </span>
                  </div>
                </div>
              </div>
            </div>
            
            <!-- 详细分析 -->
            <div class="result-details" v-if="detectionResult.details">
              <h4>详细分析</h4>
              <div class="detail-item" v-for="detail in detectionResult.details" :key="detail.type">
                <span class="detail-label">{{ detail.label }}</span>
                <span class="detail-value">{{ detail.value }}</span>
              </div>
            </div>
            
            <!-- 建议 -->
            <div class="result-suggestions" v-if="detectionResult.suggestions">
              <h4>建议</h4>
              <ul>
                <li v-for="suggestion in detectionResult.suggestions" :key="suggestion">
                  {{ suggestion }}
                </li>
              </ul>
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- 最新动态区域 -->
    <section class="news-section">
      <div class="section-container">
        <h2 class="section-title">最新动态</h2>
        <div class="news-grid">
          <div class="news-card" v-for="news in latestNews" :key="news.id">
            <div class="news-date">{{ formatDate(news.date) }}</div>
            <h3 class="news-title">{{ news.title }}</h3>
            <p class="news-excerpt">{{ news.excerpt }}</p>
            <div class="news-tags">
              <span 
                v-for="tag in news.tags" 
                :key="tag"
                class="news-tag"
              >
                {{ tag }}
              </span>
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- 统计数据区域 -->
    <section class="stats-section">
      <div class="section-container">
        <div class="stats-grid">
          <div class="stat-card" v-for="stat in stats" :key="stat.id">
            <div class="stat-number">{{ stat.value }}</div>
            <div class="stat-label">{{ stat.label }}</div>
          </div>
        </div>
      </div>
    </section>
  </div>
</template>

<script>
export default {
  name: 'Home',
  data() {
    return {
      activeTab: 'text',
      textInput: '',
      selectedImage: null,
      imagePreview: null,
      
      // 检测状态
      isDetecting: false,
      detectionProgress: 0,
      detectionStage: '',
      detectionResult: null,
      
      // 核心功能数据
      features: [
        {
          id: 1,
          icon: '🔍',
          title: '谣言检测',
          description: '利用深度学习技术，快速识别文本和图像中的谣言信息，支持多种语言和格式',
          accuracy: '95.2%',
          responseTime: '< 2s'
        },
        {
          id: 3,
          icon: '🎤',
          title: '声纹识别',
          description: '通过声纹比对技术，识别可疑通话，防范语音诈骗和冒充行为',
          accuracy: '94.1%',
          responseTime: '< 4s'
        },
        {
          id: 4,
          icon: '🖼️',
          title: 'AI生成图像检测',
          description: '检测AI生成的图像内容，识别Deepfake、GAN生成图像等人工智能伪造图片',
          accuracy: '91.5%',
          responseTime: '< 3s'
        },
        {
          id: 5,
          icon: '🎵',
          title: 'AI生成语音检测',
          description: '识别AI合成的语音内容，检测语音克隆、TTS合成音频等人工智能生成语音',
          accuracy: '88.9%',
          responseTime: '< 4s'
        },
        {
          id: 6,
          icon: '🎬',
          title: 'AI生成视频检测',
          description: '检测AI生成的视频内容，识别换脸视频、虚拟人物等深度伪造视频技术',
          accuracy: '87.3%',
          responseTime: '< 6s'
        },
        {
          id: 7,
          icon: '📝',
          title: 'AI生成文字检测',
          description: '识别AI生成的文本内容，检测ChatGPT、文本生成模型等人工智能写作内容',
          accuracy: '89.7%',
          responseTime: '< 2s'
        }
      ],
      
      // 检测标签
      detectionTabs: [
        { id: 'text', name: '文本检测' },
        { id: 'image', name: '图片检测' }
      ],
      
      // 最新动态
      latestNews: [
        {
          id: 1,
          title: '智盾清源平台新增视频深度伪造检测功能',
          excerpt: '最新版本支持检测Deepfake视频内容，准确率提升至92%以上，为用户提供更全面的AI生成内容识别服务...',
          date: new Date('2024-01-15'),
          tags: ['功能更新', 'AI检测', '视频分析']
        },
        {
          id: 2,
          title: '2024年第一季度反诈骗报告发布',
          excerpt: '平台成功拦截诈骗信息超过50万条，帮助用户避免经济损失累计达2.3亿元，网络诈骗识别准确率持续提升...',
          date: new Date('2024-01-10'),
          tags: ['数据报告', '反诈成果', '用户保护']
        },
        {
          id: 3,
          title: '声纹识别技术获得国家专利认证',
          excerpt: '智盾清源自主研发的声纹识别算法获得国家知识产权局专利认证，在电信诈骗防范领域达到国际先进水平...',
          date: new Date('2024-01-05'),
          tags: ['技术突破', '专利认证', '声纹识别']
        }
      ],
      
      // 统计数据
      stats: [
        { id: 1, value: '1,234,567', label: '累计检测次数' },
        { id: 2, value: '98.5%', label: '平均准确率' },
        { id: 3, value: '2.3亿', label: '避免损失金额' },
        { id: 4, value: '500万+', label: '服务用户数' }
      ]
    }
  },
  methods: {
    // 文本检测
    detectText() {
      if (!this.textInput.trim()) {
        alert('请输入需要检测的文本内容')
        return
      }
      
      this.startDetection()
      this.simulateTextDetection()
    },
    
    // 图片上传
    uploadImage() {
      this.$refs.imageInput.click()
    },
    
    handleImageUpload(event) {
      const file = event.target.files[0]
      if (file) {
        // 文件大小检查
        if (file.size > 10 * 1024 * 1024) {
          alert('图片大小不能超过 10MB')
          return
        }
        
        // 文件类型检查
        if (!file.type.startsWith('image/')) {
          alert('请选择图片文件')
          return
        }
        
        this.selectedImage = file
        
        // 创建预览
        const reader = new FileReader()
        reader.onload = (e) => {
          this.imagePreview = e.target.result
        }
        reader.readAsDataURL(file)
      }
    },
    
    // 图片检测
    detectImage() {
      if (!this.selectedImage) {
        alert('请先选择图片')
        return
      }
      
      this.startDetection()
      this.simulateImageDetection()
    },
    
    // 开始检测
    startDetection() {
      this.isDetecting = true
      this.detectionProgress = 0
      this.detectionResult = null
      this.detectionStage = '准备检测...'
    },
    
    // 模拟文本检测
    simulateTextDetection() {
      const stages = [
        { stage: '分析文本内容...', progress: 20 },
        { stage: '提取关键词...', progress: 40 },
        { stage: '模式匹配...', progress: 60 },
        { stage: '风险评估...', progress: 80 },
        { stage: '生成报告...', progress: 100 }
      ]
      
      let currentStage = 0
      const interval = setInterval(() => {
        if (currentStage < stages.length) {
          this.detectionStage = stages[currentStage].stage
          this.detectionProgress = stages[currentStage].progress
          currentStage++
        } else {
          clearInterval(interval)
          this.completeTextDetection()
        }
      }, 800)
    },
    
    // 模拟图片检测
    simulateImageDetection() {
      const stages = [
        { stage: '解析图片...', progress: 15 },
        { stage: '特征提取...', progress: 30 },
        { stage: '深度学习分析...', progress: 50 },
        { stage: '内容识别...', progress: 70 },
        { stage: '风险评估...', progress: 85 },
        { stage: '生成报告...', progress: 100 }
      ]
      
      let currentStage = 0
      const interval = setInterval(() => {
        if (currentStage < stages.length) {
          this.detectionStage = stages[currentStage].stage
          this.detectionProgress = stages[currentStage].progress
          currentStage++
        } else {
          clearInterval(interval)
          this.completeImageDetection()
        }
      }, 700)
    },
    
    // 完成文本检测
    completeTextDetection() {
      this.isDetecting = false
      
      // 根据文本长度判断是否为AI生成
      const isAIGenerated = this.textInput.length > 10
      const confidence = isAIGenerated ? Math.floor(Math.random() * 15) + 85 : Math.floor(Math.random() * 15) + 80
      
      this.detectionResult = {
        status: isAIGenerated ? 'risk' : 'safe',
        title: isAIGenerated ? '检测到AI生成内容' : '人工创作内容',
        description: isAIGenerated ? 
          '该文本疑似由AI生成，请注意内容的真实性和可靠性。' : 
          '该文本可能为人工创作，相对可信。',
        icon: isAIGenerated ? 'fas fa-robot' : 'fas fa-user-edit',
        confidence: confidence,
        riskLevel: isAIGenerated ? 'high' : 'low',
        details: [
          { type: 'length', label: '文本长度', value: `${this.textInput.length} 字符` },
          { type: 'threshold', label: '判断阈值', value: '10 字符' },
          { type: 'result', label: '检测结果', value: isAIGenerated ? 'AI生成' : '人工创作' },
          { type: 'confidence', label: '置信度', value: `${confidence}%` }
        ],
        suggestions: isAIGenerated ? [
          '内容可能由AI生成，建议核实真实性',
          '注意甄别AI生成内容的准确性',
          '如需引用，请标注可能来源于AI'
        ] : [
          '内容疑似人工创作，相对可信',
          '仍需注意内容的准确性和来源',
          '建议交叉验证重要信息'
        ]
      }
    },
    
    // 完成图片检测
    completeImageDetection() {
      this.isDetecting = false
      
      // 根据文件名长度判断是否为AI生成
      const fileName = this.selectedImage.name
      const isAIGenerated = fileName.length > 10
      const confidence = isAIGenerated ? Math.floor(Math.random() * 15) + 85 : Math.floor(Math.random() * 15) + 80
      
      this.detectionResult = {
        status: isAIGenerated ? 'risk' : 'safe',
        title: isAIGenerated ? '检测到AI生成图片' : '传统图片',
        description: isAIGenerated ? 
          '该图片疑似由AI生成，请注意内容的真实性和可靠性。' : 
          '该图片可能为传统拍摄或手工制作，相对可信。',
        icon: isAIGenerated ? 'fas fa-robot' : 'fas fa-camera',
        confidence: confidence,
        riskLevel: isAIGenerated ? 'high' : 'low',
        details: [
          { type: 'filename', label: '文件名', value: fileName },
          { type: 'nameLength', label: '文件名长度', value: `${fileName.length} 字符` },
          { type: 'threshold', label: '判断阈值', value: '10 字符' },
          { type: 'result', label: '检测结果', value: isAIGenerated ? 'AI生成' : '传统图片' },
          { type: 'size', label: '文件大小', value: this.formatFileSize(this.selectedImage.size) },
          { type: 'format', label: '图片格式', value: this.selectedImage.type.split('/')[1].toUpperCase() }
        ],
        suggestions: isAIGenerated ? [
          '图片可能由AI生成，建议核实真实性',
          '注意甄别AI生成图片的准确性',
          '如需使用，请标注可能来源于AI'
        ] : [
          '图片疑似传统制作，相对可信',
          '仍需注意图片内容的准确性',
          '建议核实图片的真实来源'
        ]
      }
    },
    
    // 清除相关数据
    clearText() {
      this.textInput = ''
      this.detectionResult = null
    },
    
    clearImage() {
      this.selectedImage = null
      this.imagePreview = null
      this.detectionResult = null
      if (this.$refs.imageInput) {
        this.$refs.imageInput.value = ''
      }
    },
    
    clearResult() {
      this.detectionResult = null
    },
    
    // 工具方法
    formatFileSize(bytes) {
      if (bytes === 0) return '0 Bytes'
      const k = 1024
      const sizes = ['Bytes', 'KB', 'MB', 'GB']
      const i = Math.floor(Math.log(bytes) / Math.log(k))
      return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]
    },
    
    getRiskLevelText(level) {
      const levels = {
        low: '低风险',
        medium: '中风险',
        high: '高风险'
      }
      return levels[level] || '未知'
    },
    
    formatDate(date) {
      return date.toLocaleDateString('zh-CN', {
        year: 'numeric',
        month: 'long',
        day: 'numeric'
      })
    }
  }
}
</script>

<style scoped>
.home-page {
  min-height: 100vh;
}

/* 英雄区域 */
.hero-section {
  background: url('@/assets/机器人.jpg') center center/cover no-repeat;
  min-height: 480px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-bg-mask {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(20,32,60,0.72);
  z-index: 1;
  pointer-events: none;
}
.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: 480px;
}
.hero-content {
  color: #fff;
  text-align: left;
  max-width: 600px;
  margin-left: 0;
  padding: 48px 32px 36px;
  border-radius: 18px;
  z-index: 2;
  position: relative;
}
.hero-title, .hero-subtitle, .hero-description {
  text-shadow: 0 4px 16px rgba(0,0,0,0.7), 0 1px 0 #222;
}
.hero-title {
  font-size: 62px;
  font-weight: 900;
  margin-bottom: 18px;
  letter-spacing: 2px;
}
.hero-subtitle {
  font-size: 28px;
  color: #ffd700;
  margin-bottom: 18px;
  font-weight: 700;
}
.hero-description {
  font-size: 20px;
  margin-bottom: 36px;
  color: #fff;
  font-weight: 500;
}
.hero-actions {
  display: flex;
  gap: 24px;
  justify-content: flex-start;
}
.hero-actions .btn {
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  font-size: 18px;
  font-weight: 700;
  padding: 12px 32px;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 300px;
}

.shield-icon {
  font-size: 120px;
  animation: float 3s ease-in-out infinite;
}

.search-icon {
  font-size: 60px;
  position: absolute;
  right: 20px;
  top: 20px;
  animation: pulse 2s infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* 通用样式 */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  font-size: 36px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 50px;
  color: #1e3c72;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 25px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: #ff6b35;
  color: white;
}

.btn-primary:hover {
  background: #ff5722;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: #1e3c72;
  border: 2px solid #1e3c72;
}

.btn-secondary:hover {
  background: #1e3c72;
  color: white;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* 功能区域 */
.features-section {
  padding: 80px 0;
  background: white;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.feature-card {
  background: white;
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.feature-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #1e3c72;
}

.feature-description {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin-bottom: 20px;
}

.feature-stats {
  display: flex;
  justify-content: space-around;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.stat-item {
  font-size: 12px;
  color: #888;
}

/* 快速检测区域 */
.quick-detection-section {
  padding: 80px 0;
  background: #f8f9fa;
}

.detection-tabs {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.tab-button {
  padding: 12px 30px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.tab-button.active {
  background: #1e3c72;
  color: white;
  border-color: #1e3c72;
}

.detection-content {
  max-width: 600px;
  margin: 0 auto;
}

.detection-panel {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.text-input {
  width: 100%;
  height: 150px;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 20px;
}

.text-input:focus {
  outline: none;
  border-color: #1e3c72;
}

.detection-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.upload-area {
  border: 2px dashed #ddd;
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.upload-area:hover {
  border-color: #1e3c72;
  background: #f8f9fa;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.upload-hint {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

/* 图片预览 */
.image-preview {
  text-align: center;
  margin-bottom: 20px;
}

.preview-image {
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  margin-bottom: 15px;
}

.image-info {
  margin-bottom: 15px;
}

.image-name {
  font-weight: 500;
  margin-bottom: 5px;
}

.image-size {
  font-size: 12px;
  color: #666;
  margin: 0;
}

/* 检测进度 */
.detection-progress {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 15px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1e3c72, #2a5298);
  transition: width 0.3s ease;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.detection-animation {
  text-align: center;
  position: relative;
  height: 50px;
}

.scanner {
  width: 60px;
  height: 60px;
  border: 3px solid #1e3c72;
  border-radius: 50%;
  border-top: 3px solid transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 检测结果 */
.detection-result {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.result-header h3 {
  margin: 0;
  color: #1e3c72;
}

.result-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.result-card.safe {
  background: #d4edda;
  border-left: 4px solid #28a745;
}

.result-card.risk {
  background: #f8d7da;
  border-left: 4px solid #dc3545;
}

.result-icon {
  font-size: 24px;
  margin-top: 5px;
}

.result-card.safe .result-icon {
  color: #28a745;
}

.result-card.risk .result-icon {
  color: #dc3545;
}

.result-content {
  flex: 1;
}

.result-content h4 {
  margin: 0 0 10px 0;
  color: #1e3c72;
}

.result-content p {
  margin: 0 0 15px 0;
  color: #666;
  line-height: 1.5;
}

.result-metrics {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.metric {
  display: flex;
  align-items: center;
  gap: 15px;
}

.metric-label {
  font-size: 14px;
  color: #666;
  min-width: 60px;
}

.metric-bar {
  flex: 1;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  background: linear-gradient(90deg, #1e3c72, #2a5298);
  transition: width 0.3s ease;
}

.metric-value {
  font-size: 14px;
  font-weight: 500;
  color: #1e3c72;
  min-width: 40px;
}

.risk-level {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.risk-level.low {
  background: #d4edda;
  color: #155724;
}

.risk-level.medium {
  background: #fff3cd;
  color: #856404;
}

.risk-level.high {
  background: #f8d7da;
  color: #721c24;
}

.result-details {
  margin-bottom: 20px;
}

.result-details h4 {
  margin-bottom: 15px;
  color: #1e3c72;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.detail-label {
  font-size: 14px;
  color: #666;
}

.detail-value {
  font-size: 14px;
  font-weight: 500;
  color: #1e3c72;
}

.result-suggestions {
  margin-top: 20px;
}

.result-suggestions h4 {
  margin-bottom: 15px;
  color: #1e3c72;
}

.result-suggestions ul {
  margin: 0;
  padding-left: 20px;
}

.result-suggestions li {
  margin-bottom: 8px;
  color: #666;
  line-height: 1.5;
}

/* 新闻区域 */
.news-section {
  padding: 80px 0;
  background: white;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

.news-card {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.news-card:hover {
  transform: translateY(-5px);
}

.news-date {
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}

.news-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #1e3c72;
}

.news-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin-bottom: 15px;
}

.news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.news-tag {
  background: #e3f2fd;
  color: #1976d2;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 12px;
}

/* 统计区域 */
.stats-section {
  padding: 60px 0;
  background: #1e3c72;
  color: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
}

.stat-card {
  text-align: center;
}

.stat-number {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #ffd700;
}

.stat-label {
  font-size: 16px;
  opacity: 0.9;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  
  .hero-title {
    font-size: 36px;
  }
  
  .hero-subtitle {
    font-size: 20px;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .section-title {
    font-size: 28px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .detection-tabs {
    flex-direction: column;
    align-items: center;
  }
  
  .detection-actions {
    flex-direction: column;
  }
  
  .result-card {
    flex-direction: column;
  }
  
  .metric {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
</style> 